package cn.codexin.wechatofficial.schedule;

import cn.codexin.wechatofficial.service.WarnService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author ：zhanfan
 * @date ：Created in 2020/9/13 15:30
 */
@Component
@Slf4j
public class WarningTasks {

    @Autowired
    private WarnService warnService;

    @Scheduled(fixedRate = 50 * 1000)
    public void warnSchedule() {
        log.info("设备报警信息扫描开始,开始时间: " + new Date());
        warnService.sendMVWarn();
        log.info("设备报警信息扫描结束,结束时间: " + new Date());

    }
}
